<?php
import('@.Action.PublicAction');
class StudentinfoAction extends Action
{
    function _initialize() 
    {
       if(!isset($_SESSION['user_right'])) {
			$this->redirect('login','Public');
        }
        parent::_initialize();
    }
    	
	function index()
	{
		//如果是Action的初始入口，就清空$_SESSION["map"];
		if($_REQUEST["m"]==$this->name&&$_REQUEST["a"]==""&&count($_REQUEST)==2){
			unset($_SESSION['map']);
		}
		//列表过滤器，生成查询Map对象
        $map = $this->_search();		
        if(method_exists($this,'_filter')) {
            $this->_filter($map);
        }
		$model        = D('Studentinfo');
        if(!empty($model)) {
        	$this->_list($model,$map);
        }
		//装载搜索字段
		$tabName="studentinfo";
		$modelComment=D("Comment");
		$fieldList=$modelComment->findAll("`TABLE`='".$tabName."' and `RELID`='0' and `FIELD`!='yx'");
		$this->assign("fieldList",       $fieldList);
		$this->display();
        return;
		
		/*
		$Dao = D("Studentinfo"); 
		$count = $Dao->count(); 
		import("ORG.Util.Page"); 
		if(!empty($_REQUEST["listRows"])) { 
			$listRows = $_REQUEST["listRows"]; 
			}else{ 
			$listRows = 20; 
		} 
		$p = new Page($count,$listRows); 
 
		$field = "*"; 
		//$list = $Dao->findAll("yx='商学院'",$field,"xh desc",$p->firstRow.",".$p->listRows);
		$list = $Dao->findAll("",$field,"xh desc",$p->firstRow.",".$p->listRows); 		 
		$page = $p->show(); 
		$this->assign("list",$list);
		//dump($list); 
		$this->assign("page",$page); 
		$this->display();
		return;
		*/ 
	}
    /**
     +----------------------------------------------------------
     * 根据表单生成查询条件
     * 进行列表过滤
     +----------------------------------------------------------
     * @access protected 
     +----------------------------------------------------------
     * @param string $name 数据对象名称 
     +----------------------------------------------------------
     * @return HashMap
     +----------------------------------------------------------
     * @throws ThinkExecption
     +----------------------------------------------------------
     */
    protected function _search($name='') 
    {
        //生成查询条件
		if(empty($name)) {
			$name	=	$this->name;
		}
		$model	=	D($name);
		$map	=	array();
		//加入SESSION查询条件
		if(isset($_SESSION["map"]))
		{
			foreach($_SESSION["map"] as $key=>$val){
				$map[$key]	=	$val;
			}
		}
		//加入查询条件
		if(!empty($_POST['searchValue'])){
			$map[$_POST['searchKey']]	=	$_POST['searchValue'];
		}
		
		
		//加入权限
		//$map["Studentinfo.bj"]="2004级会计学4";
		if ($_SESSION['user_right']=="6"){
			//$map['dm_yx']=$_SESSION['dm_yx'];
			//$map['dm_zy']=$_SESSION['dm_zy'];
			$map['dm_bj']=$_SESSION['dm_bj'];			
		}
		//保存查询条件到session中
		$_SESSION["map"]=$map;
		return $map;
    }	
    /**
     +----------------------------------------------------------
     * 根据表单生成查询条件
     * 进行列表过滤
     +----------------------------------------------------------
     * @access protected 
     +----------------------------------------------------------
     * @param Model $model 数据对象 
     * @param HashMap $map 过滤条件 
     * @param string $sortBy 排序 
     * @param boolean $asc 是否正序 
     +----------------------------------------------------------
     * @return void
     +----------------------------------------------------------
     * @throws ThinkExecption
     +----------------------------------------------------------
     */
    protected function _list($model,$map,$sortBy='',$asc=true) 
    {
        //排序字段 默认为主键名
        if(isset($_REQUEST['order'])) {
            $order = $_REQUEST['order'];
        }else {
            $order = !empty($sortBy)? $sortBy: $model->getPk();
        }
        //排序方式默认按照倒序排列
        //接受 sost参数 0 表示倒序 非0都 表示正序
        if(isset($_REQUEST['sort'])) {
            $sort = $_REQUEST['sort']?'asc':'desc';
        }else {
            $sort = $asc?'asc':'desc';
        }

        //dump($map);
		/*添加HashMap来修改成模糊查询 link %%*/
		import("ORG.Util.HashMap");
		$maptmp=new HashMap();
        /**/
		foreach ($map as $key=>$val){
			$maptmp->put($key,array('like',"%".$val."%"));
			//$str="";
		}
		//$map=$maptmp->values();
		//dump($map);        

		//取得满足条件的记录数
        $count      = $model->count($maptmp);
		if($count>0) {
			import("ORG.Util.Page");
			//创建分页对象
			if(!empty($_REQUEST['listRows'])) {
				$listRows  =  $_REQUEST['listRows'];
			}else {
				$listRows  =  '';
			}
			$p          = new Page($count,$listRows);
			//分页查询数据
			$voList     = $model->findAll($maptmp,'*',$order.' '.$sort,$p->firstRow.','.$p->listRows);
			//$voList     = $model->findAll("xh like '%200555%'",'*',$order.' '.$sort,$p->firstRow.','.$p->listRows);
			//分页跳转的时候保证查询条件
			foreach($map as $key=>$val) {
				if(is_array($val)) {
					foreach ($val as $t){
						$p->parameter	.= $key.'[]='.urlencode($t)."&";
					}
				}else{
					$p->parameter   .=   "$key=".urlencode($val)."&";        
				}
			}
			//分页显示
			$page       = $p->show();
			//列表排序显示
			$sortImg    = $sort ;                                   //排序图标
			$sortAlt    = $sort == 'desc'?'升序排列':'倒序排列';    //排序提示
			$sort       = $sort == 'desc'? 1:0;                     //排序方式
			//模板赋值显示
			$this->assign('list',       $voList);
			$this->assign('sort',       $sort);
			$this->assign('order',      $order);
			$this->assign('sortImg',    $sortImg);
			$this->assign('sortType',   $sortAlt);
			$this->assign("page",       $page);
		}
        return ;
    }
	

    /**
     +----------------------------------------------------------
     * 默认删除操作
     +----------------------------------------------------------
     * @access public 
     +----------------------------------------------------------
     * @return string
     +----------------------------------------------------------
     * @throws ThinkExecption
     +----------------------------------------------------------
     */
/*
    public function delete()
    {
        //删除指定记录
        $model        = D('Studentinfo');
        if(!empty($model)) {
            $id         = $_REQUEST['id'];
            if(isset($id)) {
                if($model->delete($id)){
                    $this->success(L('_DELETE_SUCCESS_'));
                }else {
                    $this->error(L('_DELETE_FAIL_'));
                }        	
            }else {
                $this->error('非法操作');
            }        	
        }
    }
*/
    /**
     +----------------------------------------------------------
     * 默认禁用操作
     * 
     +----------------------------------------------------------
     * @access public 
     +----------------------------------------------------------
     * @return string
     +----------------------------------------------------------
     * @throws FcsException
     +----------------------------------------------------------
     */
    function forbid()
    {
		$model	=	D('Studentinfo');
        $condition = 'xh IN ('.$_GET['xh'].')'; 
        if($model->setField('status','0',$condition)){
            $this->assign("message",'状态禁用成功！');
            $this->assign("jumpUrl",$this->getReturnUrl());
        }else {
            $this->assign('error',  '状态禁用失败！');
        }
        $this->forward();
    }

    /**
     +----------------------------------------------------------
     * 默认恢复操作
     * 
     +----------------------------------------------------------
     * @access public 
     +----------------------------------------------------------
     * @return string
     +----------------------------------------------------------
     * @throws FcsException
     +----------------------------------------------------------
     */
    function resume()
    {
        //恢复指定记录
		$model	=	D('Studentinfo');
        $condition = 'xh IN (\''.$_GET['xh'].'\')';
        //echo $condition; 
        //exit();
        if($model->setField('status','1',$condition)){
            $this->assign("message",'状态恢复成功！');
            $this->assign("jumpUrl",$this->getReturnUrl());
        }else {
            $this->assign('error',  '状态恢复失败！');
        }
        $this->forward();
    }
	
	function add() 
	{
		$tabName="studentinfo";
		$modelComment=D("Comment");
		$voList=$modelComment->findAll("`TABLE`='".$tabName."'");
		

		//以ID为标号的全部数据组
		foreach($voList as $v1){
			$Fields[$v1['ID']]=$v1;
		}
		//以ID为标号的代码数据组,排除YX,ZY,BJ
		foreach($Fields as $v2){
			if($v2['ISCODE']==1&$v2['RELID']!=0){
				//if($v2['FIELD']!='dm_yx'&&$v2['FIELD']!='dm_zy'&&$v2['FIELD']!='dm_bj'){
					$tmp=$v2;
					$tmp['RELNAME']=$Fields[$v2['RELID']]['FIELD'];
					$codeModel=D("Code");
					$tmp['codes']=$codeModel->findAll("`COMMENTID`='".$v2['ID']."'");
					$codeFields[$v2['ID']]=$tmp;
			//	}
			}
		}
	
		//加入选项		
		foreach($voList as $voListTmp){
			if($voListTmp['ISCODE']==1&&$voListTmp['RELID']!=0){
				$voListTmp['codes']=$codeFields[$voListTmp['ID']]['codes'];
				$voListTmp['RELNAME']=$codeFields[$voListTmp['ID']]['RELNAME'];
			}
			$voList2[]=$voListTmp;
		}
		//院系
		$codeModel=D("Code");
		$rs=$codeModel->findAll("`COMMENTID`in(5,9,11)");
		$this->assign("yxzybj",$rs);		
/*		print_r($rs);
		exit();*/
/*		//专业
		$codeModel=D("Code");
		$rs=$codeModel->findAll("`COMMENTID`='9'");
		//班级
		$codeModel=D("Code");
		$rs=$codeModel->findAll("`COMMENTID`='11'");*/
						
		$this->assign("list",$voList2);	
/*		$tabName="studentinfo";
		$modelComment=D("Comment");
		$voList=$modelComment->findAll("`TABLE`='".$tabName."'");
		$this->assign("list",$voList); */
		// 添加内容的页面 
		$this->display(); 
	} 

	function insert() 
	{ 
		// 保存添加的数据
		$Dao = D("Studentinfo"); 
		$vo = $Dao->create(); 
		if(false === $vo) { 
	 		$this->error($Dao->getError()); 
		} 
 
		$rs = $Dao->add(); 
		if($rs){ 
			$this->assign("jumpUrl",__URL__); 
			$this->success("添加数据成功!"); 
		}else{ 
			$this->error("添加数据失败"); 
		} 
	}
    /**
     +----------------------------------------------------------
     * 默认编辑操作
     +----------------------------------------------------------
     * @access public 
     +----------------------------------------------------------
     * @return string
     +----------------------------------------------------------
     * @throws ThinkExecption
     +----------------------------------------------------------
     */
	function edit() 
	{ 
		$tabName="studentinfo";
		$modelComment=D("Comment");
		$voList=$modelComment->findAll("`TABLE`='".$tabName."'");
		

		//以ID为标号的全部数据组
		foreach($voList as $v1){
			$Fields[$v1['ID']]=$v1;
		}
		//以ID为标号的代码数据组,排除YX,ZY,BJ
		foreach($Fields as $v2){
			if($v2['ISCODE']==1&$v2['RELID']!=0){
				//if($v2['FIELD']!='dm_yx'&&$v2['FIELD']!='dm_zy'&&$v2['FIELD']!='dm_bj'){
					$tmp=$v2;
					$tmp['RELNAME']=$Fields[$v2['RELID']]['FIELD'];
					$codeModel=D("Code");
					$tmp['codes']=$codeModel->findAll("`COMMENTID`='".$v2['ID']."'");
					$codeFields[$v2['ID']]=$tmp;
			//	}
			}
		}
	
		//加入选项		
		foreach($voList as $voListTmp){
			if($voListTmp['ISCODE']==1&&$voListTmp['RELID']!=0){
				$voListTmp['codes']=$codeFields[$voListTmp['ID']]['codes'];
				$voListTmp['RELNAME']=$codeFields[$voListTmp['ID']]['RELNAME'];
			}
			$voList2[]=$voListTmp;
		}
		//院系
		$codeModel=D("Code");
		$rs=$codeModel->findAll("`COMMENTID`in(5,9,11)");
		$this->assign("yxzybj",$rs);		
/*		print_r($rs);
		exit();*/
/*		//专业
		$codeModel=D("Code");
		$rs=$codeModel->findAll("`COMMENTID`='9'");
		//班级
		$codeModel=D("Code");
		$rs=$codeModel->findAll("`COMMENTID`='11'");*/
						
		$this->assign("list",$voList2);
		//print_r($codeFields);
		//exit();
		// 编辑页面 
		$Dao = D("Studentinfo"); 
		$vo = $Dao->find("xh=".$_GET["id"]); 
		if($vo === false) 
		{ 
			$this->assign("jumpUrl",__URL__); 
			$this->error("Non-existed record"); 
		} 
		 //查看是否有照片
		 if(file_exists("../Public/Photo/".$vo['xh'].".jpg")){
		 	$vo['photoname']="/Public/Photo/".$vo['xh'].".jpg";	
		 }else{
		 	$vo['photoname']="/Public/Images/nophoto.gif";
		 }
		$this->assign("vo",$vo); 
		$this->display(); 
	}
	function editPic(){
		$Dao = D("Studentinfo"); 
		$vo = $Dao->find("xh=".$_GET["id"]); 
		if($vo === false) 
		{ 
			$this->assign("jumpUrl",__URL__); 
			$this->error("Non-existed record"); 
		} 
		 //查看是否有照片
		 if(file_exists("../Public/Photo/".$vo['xh'].".jpg")){
		 	$vo['photoname']="/Public/Photo/".$vo['xh'].".jpg";	
		 }else{
		 	$vo['photoname']="/Public/Images/nophoto.gif";
		 }
		$this->assign("vo",$vo); 
		$this->display(); 	
	}  

	function update() 
	{ 
		//保存照片
		if(isset($_POST['photoName'])&&(!empty($_POST['photoName']))){
			if(file_exists("../Public/Photo/".$_POST['xh'].".jpg")) @unlink("../Public/Photo/".$_POST['xh'].".jpg");
			@rename("../Public/Uploads/".$_POST['photoName'],"../Public/Photo/".$_POST['xh'].".jpg");
		}
		// 保存编辑过的数据 
		$Dao = D("Studentinfo"); 
		$vo = $Dao->create("","edit");
		if(false === $vo) { 
	 		$this->error($Dao->getError()); 
		} 
 
		$rs = $Dao->save(); 
		if($rs){ 
			$this->assign("jumpUrl",__URL__); 
			$this->success("保存修改成功!"); 
		}else{ 
			$this->error("保存修改失败"); 
		} 
	}
	//保存照片
	function updatePic(){
		//保存照片
		if(isset($_POST['photoName'])&&(!empty($_POST['photoName']))){
			if(file_exists("../Public/Photo/".$_POST['xh'].".jpg")) @unlink("../Public/Photo/".$_POST['xh'].".jpg");
			@rename("../Public/Uploads/".$_POST['photoName'],"../Public/Photo/".$_POST['xh'].".jpg");
		}
		$this->success("保存修改成功!"); 	
	}
	

	function delete() 
	{ 
		// 根据id删除指定的记录
		$Dao = D("Studentinfo"); 
		$id = $_REQUEST["id"]; 
		if(isset($id)) { 
			$result = $Dao->getById($id); 
			if(!$result) { 
				$this->error("Non-existed record!"); 
			} 
			if($Dao->deleteById($id)){ 
				$this->assign("jumpUrl",__URL__); 
				$this->success("删除数据成功"); 
			}else { 
				$this->error("删除数据失败"); 
			}
		}else { 
			$this->error("非法操作"); 
		} 
	}
    /**
     +----------------------------------------------------------
     * 默认导出操作
     +----------------------------------------------------------
     * @access public 
     +----------------------------------------------------------
     * @return string
     +----------------------------------------------------------
     * @throws ThinkExecption
     +----------------------------------------------------------
     */	
	function exportData() {
		set_time_limit(0);
		
		//使用哪个模型和表字段注释
		$modelName="Studentinfo";
		$tabName="studentinfo";
		//准备导出数据
		$model= D($modelName);
        $map = $this->_search('studentinfo');	//列表过滤器，生成查询Map对象 		
		import("ORG.Util.HashMap");//map中的查询条件导出
		$maptmp=new HashMap();
        /*map中的查询条件导出*/
		foreach ($map as $key=>$val){
			$maptmp->put($key,array('like',"%".$val."%"));
		}	
		$list  = $model->findAll($maptmp,'*','');

		$modelComment=D("Comment");
		$vo=$modelComment->findAll("`TABLE`='".$tabName."'");
		
		//准备字段和长度,字段中文名称
		foreach($vo as $tmp){
			$fieldsize[]=$tmp['LENGTH'];
			$fieldname[]=$tmp['DBFNAME'];
			$fieldDm[]=$tmp['FIELD'];
		}
		//准备导出数据
		foreach($list as $tmp1){
			$arr="";
			foreach($fieldDm as $tmp2){
				$arr[]=$tmp1[$tmp2];
				//echo $tmp1[$tmp2]."<br>";
			}
			$field[]=$arr;
		}
		//清除过期的缓存文件(就是两分钟以前的)
		$files=glob("../Public/Uploads/*.dbf");
		foreach($files as $v){
			if(time()>(filemtime($v)+1200)){
				@unlink($v);
			}
		}
		
		//导入DBF类
        import("ORG.Io.Dbf");
		//准备数据，字段和字段大小
		//$field=array(array("2005551033","无问林","男"),array("2005551034","房磊","男"));
		
/*		$arr="";
		$arr[]="2005551033";
		$arr[]="无问林";
		$arr[]="男";
		$field[]=$arr;
		
		$arr="";
		$arr[]="2005551033";
		$arr[]="无问林";
		$arr[]="男";
		$field[]=$arr;
		
		$fieldsize[]=20;
		$fieldsize[]=30;
		$fieldsize[]=2;
		//$fieldsize=array(20,30,2);
		$fieldname[]="无问林和房11";
		$fieldname[]="无问林房22";
		$fieldname[]="无问林房33";*/
		//$fieldname=array("无问林房11","无问林房22","无问林房33");
		//写DBF文件

		$outfile=new outdbf('../Public/Uploads/'.time().".dbf",$field,$fieldsize,$fieldname,1);/*发送响应*/
		header('Content-Type: text/html; charset=UTF-8');	
		echo "<div align='center'><a href='http://".$_SERVER['HTTP_HOST']."/".str_replace("../","",$outfile->file)."'>下载地址</a></div>";
		//$this->display("edit");
/*		//读文件
		$fd=fopen($outfile->file,"rb");
		$filecontent=fread($fd,filesize($outfile->file));	
		fclose($fd);
		//下载文件
		header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
		header('Content-type: application/dbf');
		header('Content-Disposition: attachment; filename="data_'.$tabName.'_'.time().'.dbf"');
		//发送数据
		echo $filecontent;*/

	}
	
	
    /**
     +----------------------------------------------------------
     * 照片上传操作
     +----------------------------------------------------------
     * @access public 
     +----------------------------------------------------------
     * @return string
     +----------------------------------------------------------
     * @throws ThinkExecption
     +----------------------------------------------------------
     */	  

    public function upload() { 
        if(!empty($_FILES)) { 
            //如果有文件上传 上传照片 
            $this->_upload(); 
            $this->forward(); 
        } 
    } 
     
    // 文件上传 
    protected function _upload()  
    { 
		//清除过期的缓存文件(就是两分钟以前的)
		$files=glob("../Public/Uploads/*.*");
		foreach($files as $v){
			if(time()>(filemtime($v)+20)){
				@unlink($v);
			}
		}
        import("ORG.Net.UploadFile"); 
        $upload = new UploadFile(); 
        //设置上传文件大小 
        $upload->maxSize  = 3292200 ; 
        //设置上传文件类型 
        $upload->allowExts  = explode(',','jpg,gif,png,jpeg'); 
        //设置附件上传目录 
        $upload->savePath =  '../Public/Uploads/';  
        //设置需要生成缩略图，仅对图像文件有效 
       $upload->thumb =  true;  
       //设置需要生成缩略图的文件后缀 
       $upload->thumbSuffix =  '';  
       //设置缩略图最大宽度 
       $upload->thumbMaxWidth =  110;  
       //设置缩略图最大高度 
       $upload->thumbMaxHeight =  140;  

        //执行上传操作 
        if(!$upload->upload()) { 
            if($this->isAjax() && isset($_POST['_uploadFileResult'])) { 
                $uploadSuccess =  false; 
                $ajaxMsg  =  $upload->getErrorMsg(); 
            }else { 
                //捕获上传异常 
                $this->error($upload->getErrorMsg());                 
            } 
        }else{ 
            $uploadSuccess    =    true; 
            $uploadList = $upload->getUploadFileInfo(); 
            foreach($uploadList as $key=>$file) { 
                $savename[] =  $file['savename']; 
            } 
        } 
        // 判断是否有Ajax方式上传附件 
        // 并且设置了结果显示Html元素 
        if($this->isAjax() && isset($_POST['_uploadFileResult']) ) { 
            // Ajax方式上传参数信息 
            $info = Array(); 
            $info['success']  =  $uploadSuccess; 
            $info['message']   = $ajaxMsg; 
            //设置Ajax上传返回元素Id 
            $info['uploadResult'] =  $_POST['_uploadFileResult'];  
            if(isset($_POST['_uploadFormId'])) { 
                //设置Ajax上传表单Id 
                $info['uploadFormId'] =  $_POST['_uploadFormId'];  
            } 
            if(isset($_POST['_uploadResponse'])) { 
                //设置Ajax上传响应方法名称 
                $info['uploadResponse'] =  $_POST['_uploadResponse'];  
            } 
            $info['savename']   = implode(',',$savename); 
			//$info['savename']="2005551033".".jpg";
			$this->ajaxUploadResult($info); 
        } 
        return ; 
    } 

    protected function ajaxUploadResult($info)  
    { 
        // Ajax方式附件上传提示信息设置 
        // 默认使用mootools opacity效果 
        $show   = '<script language="JavaScript" src="'.WEB_PUBLIC_URL.'/Js/mootools.js"></script><script language="JavaScript" type="text/javascript">'."\n";     
        $show  .= ' var parDoc = window.parent.document;';     
        $show  .= ' var result = parDoc.getElementById("'.$info['uploadResult'].'");';    
        if(isset($info['uploadFormId'])) { 
               $show  .= ' parDoc.getElementById("'.$info['uploadFormId'].'").reset();'; 
        } 
        $show  .= ' result.style.display = "block";';    
        $show .= " var myFx = new Fx.Style(result, 'opacity',{duration:600}).custom(0.1,1);"; 
        if($info['success']) { 
            // 提示上传成功 
            $show .=  'result.innerHTML = "<div style=\"color:#3333FF\">文件上传成功！</div>";';         
            // 如果定义了成功响应方法，执行客户端方法 
            // 参数为上传的附件id，多个以逗号分割 
            if(isset($info['uploadResponse'])) { 
                $show  .= 'window.parent.'.$info['uploadResponse'].'("'.$info['savename'].'");'; 
            } 
        }else { 
            // 上传失败 
            // 提示上传失败 
            $show .=  'result.innerHTML = "<div style=\"color:#FF0000\">上传失败：'.$info['message'].'</div>";';                
        } 
        $show .= "\n".'</script>';    
        $this->assign('_ajax_upload_',$show);    
        return ; 
       }
	   
	   
	   
    /**
     +----------------------------------------------------------
     * 打印具体信息操作
     +----------------------------------------------------------
     * @access public 
     +----------------------------------------------------------
     * @return string
     +----------------------------------------------------------
     * @throws ThinkExecption
     +----------------------------------------------------------
     */	
	public function viewInfo(){
		//基本信息
		$BaseDao = D("Studentinfo"); 
		$voBase = $BaseDao->find("xh='".$_GET["xh"]."'"); 
		//奖惩信息
		$JiangchengDao = D("Jiangcheng"); 
		$voJiangcheng = $JiangchengDao->findAll("xh='".$_GET["xh"]."'");  
		//资助信息
		$ZizhuDao = D("Zizhu"); 
		$voZizhu = $ZizhuDao->findAll("xh='".$_GET["xh"]."'"); 		
		//贷款信息
		$LoanDao = D("Loan"); 
		$voLoan = $LoanDao->findAll("xh='".$_GET["xh"]."'"); 
		//社会信息
		$AsscoDao = D("Assco"); 
		$voAssco = $AsscoDao->findAll("xh='".$_GET["xh"]."'");								
		//党务信息
		$PartyDao = D("Party"); 
		$voParty = $PartyDao->find("xh='".$_GET["xh"]."'"); 
		//家庭信息
		$FamilyDao = D("Family"); 
		$voFamily = $FamilyDao->find("xh='".$_GET["xh"]."'"); 
		//毕业信息
		$GraduateDao = D("Graduate"); 
		$voGraduate = $GraduateDao->find("xh='".$_GET["xh"]."'"); 	
							
		if($voBase === false) 
		{ 
			$this->assign("jumpUrl",__URL__); 
			$this->error("Non-existed record"); 
		} 
		 //查看是否有照片
		 if(file_exists("../Public/Photo/".$voBase['xh'].".jpg")){
		 	$voBase['photoname']="/Public/Photo/".$voBase['xh'].".jpg";	
		 }else{
		 	$voBase['photoname']="/Public/Images/nophoto.gif";
		 }
		$this->assign("voBase",$voBase); 
		$this->assign("voJiangcheng",$voJiangcheng); 
		$this->assign("voZizhu",$voZizhu); 
		$this->assign("voLoan",$voLoan); 
		$this->assign("voAssco",$voAssco); 
		$this->assign("voParty",$voParty); 	
		$this->assign("voFamily",$voFamily);
		$this->assign("voGraduate",$voGraduate);													
		$this->display();
	}		
}
?>